<template>
  <div class="icebreakers">
    <div class="profile-box">
      <div class="profile-search">
        <i class="el-icon-search" style="color: #628196;font-weight: bold"></i>
        <el-input :placeholder="$t('Search')" v-model="searchParams.inputValue"></el-input>
        <div class="num-box">{{ profileShowList.length }}</div>
        <el-dropdown @command="handleProfileCommand">
          <div class="icon-more" style="padding: 2px 5px;background-color: #2b4353;border-radius: 5px;color: #fff;margin-left: 5px;cursor:pointer;">
            <i class="el-icon-more"></i>
          </div>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="on">{{ $t('Enable auto sending') }}</el-dropdown-item>
            <el-dropdown-item command="off">{{ $t('Disable auto sending') }}</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
      <div class="profile-list">
        <div
            v-for="item in profileShowList"
            :key="item.id"
            @click="handleCheckedProfile(item)"
            :class="['profile-item', item.id === checkedProfile.id ? 'active' : '']">
          <div class="profile-item-avatar">
            <img class="photo" :src="item.photo" alt="">
            <div :class="['profile-status', item.online ? 'online' : 'offline']"></div>
          </div>
          <div class="profile-info">
            <div class="profile-item-name">{{item.name}}</div>
          </div>
          <img src="@/assets/icebreakers_progress_chat.svg" class="svg-icon height_14px" alt="">
          <img src="@/assets/icebreakers_progress_mail.svg" class="svg-icon height_14px" alt="">
          <img
              @click.stop="handleChangeSendStatus(item)"
              :style="{ opacity: item.autoSendingEnabled ? '1' : '0.5'}" src="@/assets/auto_sending.svg" class="svg-icon height_14px" alt="">
        </div>
      </div>
    </div>
    <div class="icebreakers-box">
      <div class="icebreakers-box-header">
        <div>{{ $t('New Messages')}}</div>
        <el-button type="primary" icon="el-icon-plus" @click="handleOpenAddMessagedDialog">
          {{ $t("Add")}}
        </el-button>
      </div>
      <div class="new-message-list">
        <div class="new-message-item" v-for="item in newMessageList" :key="item.id">
          <div class="item-top">
            <img class="avatar" :src="checkedProfile.photo" alt="">
            <div class="type" @click="handleSendNewMessage(item)">
              <img class="avatar" :src="item.typeIcon" alt="">
              <div class="type-value">{{ item.typeValue}}</div>
            </div>
            <div class="date">
              <div class="date-value">{{ item.date }}</div>
              <i class="el-icon-delete" style="color: #67cae8" @click="handleDeleteNewMessage(item)"></i>
            </div>
          </div>
          <div class="item-bottom">
            <div class="text">{{ item.content.message }}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="icebreakers-box">
      <div class="icebreakers-box-header">
        <div>{{ $t('In progress')}}</div>
<!--        <el-button type="text" @click="handleOpenViewDialog">-->
<!--          {{ $t("View Trash")}}-->
<!--        </el-button>-->
      </div>

      <div class="new-message-list">
        <div class="new-message-item" v-for="item in inProgressList" :key="item.id">
          <div class="item-top">
            <img class="avatar" :src="checkedProfile.photo" alt="">
            <div class="type">
              <img class="avatar" :src="item.typeIcon" alt="">
              <div class="type-value">{{ item.typeValue}}</div>
            </div>
<!--            <i class="el-icon-close" style="color: #67cae8"></i>-->
          </div>
          <div class="item-bottom">
            <div class="text">{{ item.content.message }}</div>
            <div style="color:#ffffff80;flex-shrink: 0">{{ item.diffDate }}</div>
          </div>
        </div>
      </div>
    </div>
    <el-dialog
        top="10vh"
        class="new-message"
        :visible.sync="addMessageDialog"
        width="65vw">
      <div class="new-message-body">
        <div class="new-message-body-top">
          <div class="new-message-body-right">
            <div class="footer-input-wrapper">
              <div class="picker-stick-list">
                <el-popover
                    popper-class="message-emojis-popover"
                    placement="bottom">
                  <div class="message-emojis-list">
                    <div class="emojis-item"
                         @click="addMessageForm.chat+=emojisItem.emoji"
                         v-for="emojisItem in emojisList">{{ emojisItem.emoji }}</div>
                  </div>
                  <div class="emoji-icon" slot="reference">
                    <img class="img emoji-popup svg-icon height_30px" src="~@/assets/emoji.svg" alt="">
                    <img class="img_hover emoji-popup svg-icon height_30px" src="~@/assets/emoji_active.svg" alt="">
                  </div>
                </el-popover>
              </div>
              <el-input class="chat-input"
                        type="textarea"
                        :rows="20"
                        v-model="addMessageForm.chat"
                        show-word-limit
                        maxlength="300"
                        placeholder="Symbols"></el-input>
              <img class="svg-icon height_22px" src="@/assets/icebreakers_chat_nonactive.svg">
            </div>
          </div>
          <div class="new-message-body-right">
            <div class="footer-input-wrapper">
              <div class="picker-stick-list">
                <el-popover
                    popper-class="message-emojis-popover"
                    placement="bottom">
                  <div class="message-emojis-list">
                    <div class="emojis-item"
                         @click="addMessageForm.mail+=emojisItem.emoji"
                         v-for="emojisItem in emojisList">{{ emojisItem.emoji }}</div>
                  </div>
                  <div class="emoji-icon" slot="reference">
                    <img class="img emoji-popup svg-icon height_30px" src="~@/assets/emoji.svg" alt="">
                    <img class="img_hover emoji-popup svg-icon height_30px" src="~@/assets/emoji_active.svg" alt="">
                  </div>
                </el-popover>
              </div>
              <el-input class="chat-input"
                        type="textarea"
                        :rows="20"
                        v-model="addMessageForm.mail"
                        show-word-limit
                        maxlength="1000"
                        placeholder="Symbols"></el-input>
              <img class="svg-icon height_22px" src="@/assets/icebreakers_mail_nonactive.svg">
            </div>
          </div>
        </div>
        <div class="new-message-body-bottom">
          <div
              @click="handleSave"
              :class="['send-mail-btn', addMessageForm.chat.trim().length || addMessageForm.mail.trim().length ? '' : 'disabled']">{{ $t('Send to Moderation') }}</div>
        </div>
      </div>
    </el-dialog>

  </div>
</template>
<script>
import {defineComponent} from 'vue'
import {formatTime, timeDiff} from "@/utils";
import axios from "axios";

export default defineComponent({
  name: "index",
  data() {
    return {
      searchParams: {
        inputValue: ''
      },
      profileList: [],
      checkedProfile: {},
      newMessageList:[],
      viewDialog: false,
      inProgressList: [],
      addMessageDialog: false,
      emojisList: [],
      addMessageForm: {
        chat: '',
        mail: ''
      }
    }
  },
  computed: {
    profileShowList() {
      return this.profileList.filter(item => {
        return item.name && item.name.includes(this.searchParams.inputValue)
      })
    },
  },
  mounted() {
    axios.get('/emojis.json').then(res => {
      this.emojisList = res.data
    })
    this.getProfileList()
  },
  methods: {
    // 获取配置
    getProfileList() {
      this.$http.getProfileList().then(res => {
        this.$http.getIBList().then(res2 => {
          this.profileList = res.map(el => {
            const find = res2[el.profile_id] || {
              "autoSendingEnabled": false,
              "hasMessage": false,
              "hasMail": false,
              "messageUpdatedRecently": false,
              "mailUpdatedRecently": false
            }
            return {
              ...el,
              ...find
            }
          })
        })
      })
    },
    handleChangeSendStatus(item) {
      this.$http.updateIBStatus(item.autoSendingEnabled ? 'disable' : 'enable',{
        profiles: [item.profile_id]
      }).then(res => {
        item.autoSendingEnabled = !item.autoSendingEnabled
      })
    },
    handleProfileCommand(item) {
      const ids = this.profileList.map(el => el.profile_id)
      this.$http.updateIBStatus(item === 'on' ? 'enable' : 'disable',{
        profiles: ids
      }).then(res => {
        this.profileList.forEach(el => {
          el.autoSendingEnabled = item === 'on'
        })
      })
    },
    handleCheckedProfile(item) {
      this.checkedProfile = item
      this.getIBNewMessageList()
      this.getIBInProgressList()
    },
    // 获取new message
    getIBNewMessageList() {
      this.$http.getIBNewMessageList({
        profileId: this.checkedProfile.profile_id
      }).then(res => {
        this.newMessageList = res.items.map(el => {
          return {
            ...el,
            // typeIcon
            typeIcon: el.type === 'message' ? require('@/assets/icebreakers_progress_chat.svg') : require('@/assets/icebreakers_progress_mail.svg'),
            // typeValue
            typeValue: el.type === 'message' ? this.$t('Send Chat Message') : this.$t('Send Email'),
            // date
            date: formatTime(el.dateCreated, 'YYYY-MM-DD')
          }
        })
      })
    },
    // 获取in progress列表
    getIBInProgressList() {
      this.$http.getIBInProgressList({
        profileId: this.checkedProfile.profile_id
      }).then(res => {
        this.inProgressList = res.items.map(el => {
          return {
            ...el,
            // typeIcon
            typeIcon: el.type === 'message' ? require('@/assets/icebreakers_progress_chat.svg') : require('@/assets/icebreakers_progress_mail.svg'),
            // typeValue
            typeValue: el.type === 'message' ? this.$t('Send Chat Message') : this.$t('Send Email'),
            // date
            date: formatTime(el.dateCreated, 'YYYY-MM-DD')
          }
        })
      }).catch(() => {
        let res = {
          "items": [
            {
              "id": 9474104,
              "content": {
                "message": "Hey handsome, do you have a favorite quote that resonates with your life philosophy? I'd love to hear it!"
              },
              "type": "message",
              "isActive": false,
              "dateCreated": "2023-07-23 13:43:22.000Z",
              "dateLastLaunched": "2023-08-27 12:00:48.000Z"
            },
            {
              "id": 9326623,
              "content": {
                "message": "I can't even imagine that I will be here .... , but, as can be seen, haha, I'm writing about myself here if he wants to get to know me a little closer :) I actually came here with great hope. I came here with the belief that my dreams, my enthusiasm will become a reality. What can I say about myself? Well ...... I can't tell a cool story, I can't tell you that I'm the most beautiful woman on the planet, I can't because it's not like that. But I can talk about how good my heart and soul are and how I often help people, animals in need. I can talk about how I improve myself, enjoy life, and how much I love what I do. (I will be able to talk about the fact that I work tirelessly to improve myself from a physical perspective and a spiritual perspective) I can tell the story of my life and open my soul if you want. Because I didn't come here for a \"night of chat\", haha, as silly as that sounds."
              },
              "type": "mail",
              "isActive": false,
              "dateCreated": "2023-06-28 16:27:21.000Z",
              "dateLastLaunched": "2023-08-27 10:16:29.000Z"
            }
          ],
          "total": 2,
          "cursor": ""
        }
        this.inProgressList = res.items.map(el => {
          return {
            ...el,
            // typeIcon
            typeIcon: el.type === 'message' ? require('@/assets/icebreakers_progress_chat.svg') : require('@/assets/icebreakers_progress_mail.svg'),
            // typeValue
            typeValue: el.type === 'message' ? this.$t('Send Chat Message') : this.$t('Send Email'),
            // date
            diffDate: timeDiff(el.dateCreated, el.dateLastLaunched),
          }
        })
        setTimeout(() => {
          this.inProgressList = this.inProgressList.map(el => {
            return {
              ...el,
              // date
              diffDate: timeDiff(el.dateCreated, el.dateLastLaunched),
            }
          })
        },1000)
      })
    },
    // 打开添加消息弹窗
    handleOpenAddMessagedDialog() {
      this.addMessageDialog = true
      this.addMessageForm = {
        chat: '',
        mail: ''
      }
    },
    async handleSave() {
      if (this.addMessageForm.chat) {
        await this.$http.addIB({
          info: {
            content: {
              message: this.addMessageForm.chat
            },
            profileId: this.checkedProfile.profile_id,
            type: "message"
          }
        })
      }
      if (this.addMessageForm.mail) {
        await this.$http.addIB({
          info: {
            content: {
              message: this.addMessageForm.chat
            },
            profileId: this.checkedProfile.profile_id,
            type: "mail"
          }
        })
      }
      this.addMessageDialog = false
      this.$message.success(this.$t('Success'))
    },
    // 发送消息
    handleSendNewMessage(item) {
      this.$http.sendIB({
        profileId: this.checkedProfile.profile_id,
        itemId: item.id,
        itemType: item.type
      }).then(res => {
        this.$message.success(this.$t('Success'))
        // 刷新页面
        this.getIBNewMessageList()
        this.getIBInProgressList()
      })
    },
    // 删除西澳西
    handleDeleteNewMessage(item) {
      // scheduler/icebreakers/trash
      this.$http.trashIb({
        profileId: this.checkedProfile.profile_id,
        id: item.id,
        type: item.type,
        message: item.content.message
      }).then(res => {
        this.$message.success(this.$t('Success'))
        // 刷新页面
        this.getIBNewMessageList()
        this.getIBInProgressList()
      })
    },
    // 打开添加消息弹窗
    handleOpenViewDialog() {

    },
  }
})
</script>

<style lang="scss">
.icebreakers {
  display: grid;
  grid-template-columns: 2fr 3fr 3fr;
  grid-gap: 1rem;
  height: calc(100vh - min(4rem,2.917vw));
  padding: min(calc(8 / 14 * 1rem),calc(8 / (1920 / 100) * 1vw)) 0 min(calc(25 / 14 * 1rem),calc(25 / (1920 / 100) * 1vw)) 0;
  overflow: hidden;
  font-family: Manrope,sans-serif;
  .new-message {
    padding: 2.5vh;
    .el-dialog {
      overflow: hidden;
    }
    .chat-message-item {
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 10%;
      max-width: 75%;
      margin: min(0.5rem,0.365vw) min(0.429rem,0.313vw);
      &.customer {
        align-self: flex-start !important;
      }
      &.profile {
        align-self: flex-end !important;
        .message-wrapper {
          flex-direction: row-reverse;
        }
        .message-right {
          .message-content {
            align-self: flex-end;
          }
          .message-time {
            margin-left: auto;
          }
        }
      }
      .message-wrapper{
        display: flex;
        gap: min(0.571rem,0.417vw);
        .avatar-box {
          display: flex;
          flex-direction: column;
          gap: 0.571rem;
          .el-image{
            align-self: start;
            width: 2.714rem;
            height: 2.714rem;
            border-radius: 0.571rem;
          }
          .mail-message-time {
            width: 2.714rem;
            color: #d5d5d5;
            font-size: .786rem;
            font-weight: 500;
            line-height: 100%;
          }
        }
      }
      .mail-right {
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        height: -moz-fit-content;
        height: fit-content;
        padding: 1.143rem;
        border-radius: 1.143rem 0.214rem 1.143rem 1.143rem;
        outline: 1px solid rgba(148,244,255,.2);
        background-color: #ffffff14;
        color: #c1c1c1;
        font-family: Inter,sans-serif;
        font-size: 1.071rem;
        font-weight: 400;
        font-style: normal;
        line-height: 150%;
        text-align: justify;
        .mail-name {
          font-family: Manrope,sans-serif;
          font-size: 1.071rem;
          font-weight: 700;
        }
        .mail-content {
          text-align: justify;
          word-break: break-all;
          margin-bottom: 5px;
        }
        .mail-file-total {
          display: inline;
          border-radius: 0.571rem;
          background-color: #2b4353;
          color: #7be6fb;
          font-size: .714rem;
          padding: 4px 5px;
          margin: 5px 0;
          cursor: pointer;
        }
        .mail-file-list {
          display: flex;
          flex-wrap: wrap;
          margin-top: 0.5rem;
          .photo,
          .video{
            display: inline-block;
            width: 7.14rem;
            height: 7.14rem;
            margin-right: 0.5rem;
            border-radius: 0.36rem;
            position: relative;

            .preview-btn {
              display: none;
              position: absolute;
              bottom: 0;
              left: 0;
              width: 100%;
              height: min(calc(22 / 14 * 1rem),calc(22 / (1920 / 100) * 1vw));
              cursor: pointer;
              border-radius: min(calc(4 / 14 * 1rem),calc(4 / (1920 / 100) * 1vw)) min(calc(4 / 14 * 1rem),calc(4 / (1920 / 100) * 1vw)) min(calc(8 / 14 * 1rem),calc(8 / (1920 / 100) * 1vw)) min(calc(8 / 14 * 1rem),calc(8 / (1920 / 100) * 1vw));
              color: #67cae8;
              font-size: min(calc(12 / 14 * 1rem),.625vw);
              font-weight: 600;
              letter-spacing: .01rem;
              text-align: center;
              line-height: min(calc(22 / 14 * 1rem),calc(22 / (1920 / 100) * 1vw));
              background: rgba(14,34,46,.88);
            }
            .video_play {
              position: absolute;
              top: 50%;
              left: 50%;
              transform: translate(-50%,-50%);
            }
            &:hover {
              .preview-btn {
                display: block;
                transition: .2s ease-in-out;
              }
            }
          }
        }
      }
      .message-right {
        display: flex;
        flex-direction: column;
        gap: 0.286rem;
        color: #d5d5d5;
        .message-content {
          width: fit-content;
          line-height: 150%;
          text-align: justify;
          word-break: break-word;
          .photo-batch {
            display: flex;
            flex-flow: row wrap;
            gap: 0.5rem;
            justify-content: flex-end;
            background: 0;
          }
          .text-message,
          .like-wrapper,
          .newsfeed-like,
          .wink,
          .sticker,
          .virtual-gift,
          .post {
            padding: 1rem;
            border-radius: 1.143rem 1.143rem 1.143rem 0.214rem;
            background: rgba(255,255,255,.08);
            font-size: 1.071rem;
          }
          .sticker img {
            max-width: 4.86rem;
            max-height: 4.86rem;
          }
        }
        .message-time {
          opacity: .5;
          font-size: .786rem;
        }
      }

    }

    .new-message-body {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 0.714rem;
      overflow: hidden;
      .new-message-body-top {
        display: grid;
        grid-template-columns: 10fr 15fr;
        grid-template-rows: 1fr auto;
        gap: 0.714rem;
        height: 100%;
        background-color: #233645;
      }
      .new-message-body-left {
        height: 100%;
        border-radius: 1.07rem;
        background: linear-gradient(#0E222E,#102535);
        position: relative;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column-reverse;
      }
      .new-message-body-right {
        border-radius: 1.07rem;
        background: linear-gradient(#0E222E,#102535);
        position: relative;
        display: flex;
      }
      .new-message-body-bottom {
        display: flex;
        margin-right: 0.65rem;
        line-height: 150%;
        justify-content: flex-end;
        .attach-file-btn {
          background: #122A3A;
          box-sizing: border-box;
          padding: 1.2vh 1.3vw;
          cursor: pointer;
          border: 0;
          border-radius: 0.571rem;
          color: #dfdfdf;
          font-size: 1rem;
          font-weight: 600;
          &:hover {
            background: #2c485f;
          }
        }
        .send-mail-btn {
          box-sizing: border-box;
          padding: 1.2vh 1.3vw;
          cursor: pointer;
          border: 0;
          border-radius: 0.571rem;
          color: #dfdfdf;
          font-size: 1rem;
          font-weight: 600;
          background: linear-gradient(0deg,#0E222E,#0E222E),#94F4FF;
          &.disabled {
            cursor: default;
            border-color: #354552;
            background: linear-gradient(0deg,#354552,#354552),#94F4FF;
            color: #848383d4;
          }
          // hover 不包含className为disabled
          &:hover:not(.disabled) {
            background: #2c485f;
          }
        }
      }
    }

    .footer-input-wrapper {
      display: flex;
      flex: 1 0 75%;
      gap: min(0.214rem,0.156vw);
      padding: min(0.714rem,0.521vw);
      .chat-input {
        .el-textarea__inner {
          height: 100%;
          background: transparent;
          border: none;
          color: #ffffff;
          font-size: 1.071rem;
          line-height: 150%;
          text-align: justify;
          line-break: anywhere;
          font-family: Manrope,sans-serif;
          padding: 0 !important;
          padding-left: 5px !important;
        }
        .el-input__count {
          left: 10px;
          right: initial;
          background: transparent;
          opacity: .2;
          color: #fff;
          font-family: Manrope,sans-serif;
          font-size: min(.714rem,.521vw);
          font-weight: 300;
        }
        .el-textarea__inner::placeholder {
          color: #6c757d;
          opacity: .75;
        }
      }
      .picker-stick-list {
        display: flex;
        flex: 0 0 min(2.143rem,1.563vw);
        flex-direction: column;
        gap: min(0.714rem,0.521vw);
      }
    }
    .emoji-icon {
      .img_hover {
        display: none;
      }
      .img {
        display: block;
      }
      &:hover {
        .img_hover {
          display: block;
        }
        .img {
          display: none;
        }
      }
    }
  }

  .icebreakers-box {
    display: flex;
    flex-direction: column;
    gap: 1.143rem;
    padding: min(calc(12 / 14 * 1rem),0.625vw) min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
    border: 1px solid rgba(18,16,16,.1);
    border-radius: 0.714rem;
    background: #122A3A;
    .icebreakers-box-header {
      display: flex;
      grid-gap: 0.5rem;
      align-items: center;
      justify-content: space-between;
      height: 2.857rem;
      padding: 0 min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
      border-radius: 0.714rem;
      color: #dfdfdf;
      font-size: min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
      font-weight: 700;
      white-space: nowrap;
    }
    .new-message-list {
      display: flex;
      flex-direction: column;
      gap: 0.571rem;
      scrollbar-color: #0E222E;
      scrollbar-width: thin;
      height: calc(100vh - 11.443rem);
      padding-right: min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
      overflow-x: hidden;
      overflow-y: auto;
      .new-message-item {
        display: flex;
        flex-direction: column;
        gap: min(calc(10 / 14 * 1rem),calc(10 / (1920 / 100) * 1vw));
        padding: 0.75rem;
        border: 1px solid #253B49;
        border-radius: 0.571rem;
        background: #253B49;
        font-size: min(1rem,calc(14 / (1920 / 100) * 1vw));
        &:hover {
          border-color: #67cae8;
        }
        .item-top {
          display: flex;
          gap: 0.5rem;
          align-items: center;
          height: 2rem;
          .avatar {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.714rem;
            height: 1.714rem;
            border-radius: 0.286rem
          }
          .type {
            display: flex;
            align-items: center;
            margin-right: auto;
            padding: 0.357rem 0.571rem;
            cursor: pointer;
            opacity: .65;
            border-radius: 0.286rem;
            background: rgba(47,103,126,.32);
            color: #67cae8;
            column-gap: 0.714rem;
            .type-value {

            }
          }
          .date {
            display: flex;
            gap: min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
            align-items: center;
            .date-value {
              opacity: .5;
              color: #fdfdfd;
              font-size: .786rem;
            }
          }
        }
        .item-bottom {
          display: grid;
          grid-template-columns: auto min(calc(60 / 14 * 1rem),3.125vw);
          gap: min(calc(16 / 14 * 1rem),calc(16 / (1920 / 100) * 1vw));
          .text {
            color: #97bad1;
            font-size: min(1rem,calc(14 / (1920 / 100) * 1vw));
            text-align: justify;
          }
        }
      }
    }
  }
  .profile-box {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.857rem;
    height: 100%;
    padding: 0.571rem;
    overflow: hidden;
    border-radius: 0.857rem;
    background-color: #122a3a;
    .profile-search {
      display: flex;
      align-items: center;
      padding-right: 1rem;
      border-radius: 0.571rem;
      background-color: #0e222e;
      .el-input__inner {
        border: none;
        &:focus {
          border: none;
        }
      }

      .num-box {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.429rem 0.714rem;
        opacity: .8;
        border-radius: 0.429rem;
        background-color: #0a3d62;
        color: #fff;
        font-size: .857rem;
      }
    }
    .profile-list {
      display: flex;
      flex-direction: column;
      gap: 0.286rem;
      height: 100%;
      padding: 0.429rem min(calc(10 / 14 * 1rem),calc(10 / (1920 / 100) * 1vw)) 0 0;
      overflow-x: hidden;
      overflow-y: auto;
      .profile-item {
        background-color: #1d3b4e;
        display: grid;
        grid-template-columns: auto 1fr 2rem 2rem 2rem;
        gap: 0.571rem;
        align-items: center;
        padding: min(calc(8 / 14 * 1rem),calc(8 / (1920 / 100) * 1vw));
        cursor: pointer;
        border: 1px solid #3C6382;
        border-radius: 0.571rem;
        background: #193343;
        color: #dfdfdf;
        .photo {
          width: min(3.42857rem, 2.5vw);
          height: min(3.42857rem, 2.5vw);
          border-radius: min(calc(8 / 14 * 1rem),calc(8 / (1920 / 100) * 1vw));
          object-fit: cover;
        }
        &.active {
          background-color: #1d3b4e;
          .profile-item-name {
            color: #80d1f4;
          }
        }
      }
      .profile-info {
        display: flex;
        gap: 0.286rem;
        width: 100%;
        overflow: hidden;
        white-space: nowrap;
        .profile-item-name {
          overflow: hidden;
          font-size: min(1rem,calc(14 / (1920 / 100) * 1vw));
          font-weight: 700;
          text-overflow: ellipsis;
        }
      }
      .profile-item-avatar {
        position: relative;
        .profile-status {
          position: absolute;
          right: 0;
          bottom: 1px;
          width: 1rem;
          height: 1rem;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 50%;
          background: #0E222E;
          box-shadow: inset 0 0.286rem 0.286rem #000;
        }
      }
    }
  }
}
</style>
